﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.announcements {
    import flash.events.*;
    import __AS3__.vec.*;
    import scripting.*;

    public class AnnouncementData extends EventDispatcher implements IScriptingContext {

        private static const FLAG_PREFIX:String = "announcements_";

        protected var m_id:String;
        protected var m_validations:Vector.<Script>;
        protected var m_view:Object;
        protected var m_priority:int;

        public function AnnouncementData(_arg1:String, _arg2:Object=null, _arg3:int=0){
            this.m_validations = new Vector.<Script>();
            super();
            this.m_id = _arg1;
            this.m_view = _arg2;
            this.m_priority = _arg3;
        }
        public function get view():Object{
            return (this.m_view);
        }
        public function get id():String{
            return (this.m_id);
        }
        public function get priority():int{
            return (this.m_priority);
        }
        public function get seenFlag():String{
            return ((FLAG_PREFIX + this.m_id));
        }
        public function get hasNotSeen():Boolean{
            return (!(Global.player.getSeenFlag(this.seenFlag)));
        }
        public function attachScript(_arg1:Script):void{
            this.m_validations.push(_arg1);
        }
        public function validate():Boolean{
            var _local2:Script;
            var _local1:Boolean;
            for each (_local2 in this.m_validations) {
                _local1 = false;
                if (_local2.validates()){
                    return (true);
                };
            };
            return (_local1);
        }
        public function onValidate():void{
        }
        public function setAsSeen():void{
            Global.player.setSeenFlag(this.seenFlag);
        }

    }
}//package Classes.announcements 
